home *** CD-ROM | disk | FTP | other *** search
- Path: csus.edu!news
- From: wleong@sfsu.edu (Jerry Leong)
- Newsgroups: comp.lang.c
- Subject: Optimization Q: for( i=0; i<SIZE/2; i++) ??
- Date: Fri, 16 Feb 1996 09:40:41 GMT
- Organization: California State University Sacramento
- Message-ID: <4g1j9n$ooe@news.csus.edu>
- NNTP-Posting-Host: wleong@pluto.sfsu.edu
- X-Newsreader: Forte Free Agent 1.0.82
-
-
- This question has been bothering me for quite a while now.
-
- If I have the following for loop,
- for( i=0; i< SIZE/2 ; i++).....
- Will the code execute faster if I precompute SIZE/2 before hand and
- do this
- k = SIZE/2;
- for(i=0; i<k ; i++).....
-
- How does this work? I mean, would SIZE/2 get computed everytime during
- the for loop, or it simply caculated once?
-
- Thanx in advance!
-
-